package com.lznb.cloud.repository;

import com.lznb.cloud.entity.NewsCategory;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

/**
 * 栏目
 * @author mzy
 * @email 1992lcg@163.com
 * @date ${datetime}
 */
public interface NewsCategoryRepository extends JpaRepository<NewsCategory, String>, JpaSpecificationExecutor<NewsCategory> {


    /**
     * 根据父栏目查询栏目
     * @param categoryId
     * @return
     */
    @Query(value = "select c from NewsCategory c where c.categoryPid=:categoryPid")
    List<NewsCategory>findByCategoryPid(@Param("categoryPid") String categoryPid);



}
